-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix flaky test-http-client-timeout-with-data #10431
Conversation
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`.
Sample failure in CI: https://ci.nodejs.org/job/node-test-commit-osx/6810/nodes=osx1010/console: not ok 1302 sequential/test-http-client-timeout-with-data
---
duration_ms: 0.358
severity: fail
stack: |-
assert.js:85
throw new assert.AssertionError({
^
AssertionError: 0 == 1
at process.<anonymous> (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx1010/test/sequential/test-http-client-timeout-with-data.js:10:10)
at emitOne (events.js:101:20)
at process.emit (events.js:188:7) |
(Oh, moved back to |
CI stress test showing current version failing under load: https://ci.nodejs.org/job/node-stress-single-test/1094/nodes=osx1010/console CI stress test showing the version in this PR succeeding under load: https://ci.nodejs.org/job/node-stress-single-test/1095/nodes=osx1010/console |
/cc @nodejs/testing Also /cc @bnoordhuis to make sure I'm not undermining some subtlety in the test |
Still trying to get a review on this one. Maybe @nodejs/platform-freebsd or @nodejs/http ? |
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: nodejs#10431 Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 0b33ef8 |
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <jasnell@gmail.com>
Description of change
test-http-client-timeout-with-data has failed here and there in CI on
FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer
set for 100ms. However, they are not necessarily set in the same tick of
the event loop and their ordering is therefore not guaranteed.
Instead of using a timer, this change listens for an event on the
listener to know when the socket timeout has occurred and then runs the
code originally in the timer.
Additional refactoring: Replaced
process.on('exit', ...)
checks withcommon.mustCall()
and replaced usage ofassert.equal()
withassert.strictEqual()
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test http